home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-settings.php < prev    next >
Encoding:
PHP Script  |  2004-11-28  |  3.0 KB  |  79 lines

  1. <?php
  2. $HTTP_HOST = getenv('HTTP_HOST');  /* domain name */
  3. $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
  4. $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
  5.  
  6. // Fix for IIS, which doesn't set REQUEST_URI
  7. $_SERVER['REQUEST_URI'] = ( isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME'] . (( isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '')));
  8.  
  9. // Change to E_ALL for development/debugging
  10. error_reporting(E_ALL ^ E_NOTICE);
  11.  
  12. // Table names
  13. $tableposts               = $table_prefix . 'posts';
  14. $tableusers               = $table_prefix . 'users';
  15. $tablesettings            = $table_prefix . 'settings'; // only used during upgrade
  16. $tablecategories          = $table_prefix . 'categories';
  17. $tablepost2cat            = $table_prefix . 'post2cat';
  18. $tablecomments            = $table_prefix . 'comments';
  19. $tablelinks               = $table_prefix . 'links';
  20. $tablelinkcategories      = $table_prefix . 'linkcategories';
  21. $tableoptions             = $table_prefix . 'options';
  22. $tableoptiontypes         = $table_prefix . 'optiontypes';
  23. $tableoptionvalues        = $table_prefix . 'optionvalues';
  24. $tableoptiongroups        = $table_prefix . 'optiongroups';
  25. $tableoptiongroup_options = $table_prefix . 'optiongroup_options';
  26. $tablepostmeta            = $table_prefix . 'postmeta';
  27.  
  28. define('WPINC', 'wp-includes');
  29.  
  30. require_once (ABSPATH . WPINC . '/wp-db.php');
  31.  
  32. $wpdb->hide_errors();
  33. $users = $wpdb->get_results("SELECT * FROM $tableusers");
  34. if (!$users && !strstr($_SERVER['PHP_SELF'], 'install.php')) {
  35.     die("It doesn't look like you've installed WP yet. Try running <a href='wp-admin/install.php'>install.php</a>.");
  36. }
  37. $wpdb->show_errors();
  38.  
  39. require (ABSPATH . WPINC . '/functions.php');
  40. require (ABSPATH . WPINC . '/functions-formatting.php');
  41. require (ABSPATH . WPINC . '/template-functions.php');
  42. require (ABSPATH . WPINC . '/links.php');
  43. require (ABSPATH . WPINC . '/kses.php');
  44. require_once (ABSPATH . WPINC . '/wp-l10n.php');
  45.  
  46. if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import')) {
  47.  
  48.     $querystring_start = '?';
  49.     $querystring_equal = '=';
  50.     $querystring_separator = '&';
  51.     //}
  52.     // Used to guarantee unique cookies
  53.     $cookiehash = md5(get_settings('siteurl'));
  54.         define('COOKIEHASH', $cookiehash); 
  55. } //end !$_wp_installing
  56.  
  57. require (ABSPATH . WPINC . '/vars.php');
  58.  
  59.  
  60. // Check for hacks file if the option is enabled
  61. if (get_settings('hack_file')) {
  62.     if (file_exists(ABSPATH . '/my-hacks.php'))
  63.         require(ABSPATH . '/my-hacks.php');
  64. }
  65.  
  66. if (!strstr($_SERVER['PHP_SELF'], 'wp-admin/plugins.php') && get_settings('active_plugins')) {
  67.     $current_plugins = explode("\n", (get_settings('active_plugins')));
  68.     foreach ($current_plugins as $plugin) {
  69.         if (file_exists(ABSPATH . 'wp-content/plugins/' . $plugin))
  70.             include(ABSPATH . 'wp-content/plugins/' . $plugin);
  71.     }
  72. }
  73.  
  74. function shutdown_action_hook() {
  75.     do_action('shutdown', '');
  76. }
  77. register_shutdown_function('shutdown_action_hook');
  78.  
  79. ?>